package com.shuzijun.leetcode.editor.cn;
public class JianShengZiLcof{
    public static void main(String[] args) {
         Solution solution = new JianShengZiLcof().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int cuttingRope(int n) {
        if (n == 1)return 1;
        if (n == 2) return 1;
        if (n == 3) return 2;
        int[] dp = new int[n + 1];
        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                if (dp[i] < j* dp[i-j]){
                    dp[i] = j* dp[i-j];
                }
            }
        }
        return dp[n];

    }
}
//leetcode submit region end(Prohibit modification and deletion)

}